package com.ruoyi.project.mahjong.mapper;

import java.util.List;

import com.ruoyi.project.mahjong.domain.Commodity;
import com.ruoyi.project.mahjong.domain.TOpenMoney;
import com.ruoyi.project.mahjong.domain.vo.UpgradReportVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * 会员开桌中商品消费Mapper接口
 *
 * @author ruoyi
 * @date 2023-10-10
 */
public interface TOpenMoneyMapper
{
    /**
     * 查询会员开桌中商品消费
     *
     * @param id 会员开桌中商品消费ID
     * @return 会员开桌中商品消费
     */
    public TOpenMoney selectTOpenMoneyById(Long id);
    public List <TOpenMoney> selectTOpenMoneyBymemberId(String memberId,String orderNumber);

    /**
     * 查询会员开桌中商品消费列表
     *
     * @param tOpenMoney 会员开桌中商品消费
     * @return 会员开桌中商品消费集合
     */
    public List<TOpenMoney> selectTOpenMoneyList(TOpenMoney tOpenMoney);

    /**
     * 新增会员开桌中商品消费
     *
     * @param tOpenMoney 会员开桌中商品消费
     * @return 结果
     */
    public int insertTOpenMoney(TOpenMoney tOpenMoney);

    /**
     * 修改会员开桌中商品消费
     *
     * @param tOpenMoney 会员开桌中商品消费
     * @return 结果
     */
    public int updateTOpenMoney(TOpenMoney tOpenMoney);

    /**
     * 删除会员开桌中商品消费
     *
     * @param id 会员开桌中商品消费ID
     * @return 结果
     */
    public int deleteTOpenMoneyById(Long id);

    /**
     * 批量删除会员开桌中商品消费
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteTOpenMoneyByIds(Long[] ids);

    List<TOpenMoney> selectMemberByProductMoney(String orderNumber);
    List<TOpenMoney> getMemberProductCostMoney(String orderNumber);
   @Update("update   t_open_money t set t.status='1'    where t.order_number=#{orderNumber} ")
    Integer deleteByOrderNumber(String orderNumber);
    @Delete("delete  from t_open_money t where t.order_number=#{orderNumber} and member_id= #{id} ")
    Integer deleteByOrderNumberAndMemberId(String orderNumber,Long id);
    List<Commodity> selectProductInfoByIds(List<Long> ids);


    List<TOpenMoney> selectOneMemberProductMoney(@Param("memberId") Long memberId, @Param("orderNumber")String orderNumber);

    Integer updateRemark(@Param("orderNumber")String orderNumber,@Param("remark") String remark);

    List<UpgradReportVo> selectReport(@Param("startTime") String startTime, @Param("endTime")String endTime,@Param("shopId") Long shopId);
}
